package com.book.oauth.server.model.hystrix.impl;

import com.book.common.api.impl.BaseHystrixImpl;
import com.book.oauth.server.model.dto.ModelDto;
import com.book.oauth.server.model.vo.ModelVo;
import com.book.oauth.server.model.hystrix.IModelHystrix;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * Description：模块 HystrixImpl
 * @Author： leo.xiong
 * @CreateDate： 2020-05-26
 * @Email： leo.xiong@suyun360.com
 * Version: 
 */
@Slf4j
@Component
public class ModelHystrixImpl extends BaseHystrixImpl<ModelDto, ModelVo> implements FallbackFactory<IModelHystrix>, IModelHystrix {

    @Override
    public IModelHystrix create(Throwable e) {
        log.error("oauth-server.ModelHystrixImpl.模块服务调用失败:{}", e.getMessage());
        e.printStackTrace();
        return new ModelHystrixImpl();
    }
}
